Call Unfolding Strategies for Equational Logic Programs

نویسندگان

  • David Sherman
  • Robert Strandh
چکیده

For a programming system based on term rewrite rules such as equational logic programming, a serious eeciency problem of the generated code is the creation of terms that only serve to drive further pattern matching. In this paper, we deene a terminating call unfolding strategy based on ne-grain partial evaluation that removes much of this unnecessary term allocation for programs in intermediate EM code generated from equational logic programs. Our approach is based on calculation, for each instruction , of two sets that reeect the usage of registers in nite execution paths of the program. These sets are calculated using xed-point iteration over the graph representation of the intermediate code. 1 Introduction Finding call unfolding strategies for partial evaluation is an annoying problem. On the one hand, the basic problem| knowing how much unfolding is necessary to expose a particular computation if it occurs|is undecidable. Nearly any recursive deenition can lead to unbounded unfolding by the partial evaluator. On the other hand, there are a great number of common cases when it is clear that a certain amount of unfolding will permit signiicant performance gains. Consider the simple example of an expression g(a; b) + f (a; b) in a functional setting where f (x; y) = g(x; y); unfolding the f call once permits us to share the g call. Caught between possible untermination in the rst case and obviously poor performance in the second, we search for heuristics, terminating strategies that give \good enough" results. In this work we consider call unfolding in the context of equational logic programming. The actual unfolding and partial evaluation is performed on an imperative intermediate language, EM code, but as we will see the strategies depend ercely upon properties of forward-branching equa-tional logic programs and the pattern-matching automata we create for them.

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Narrowing-Driven Partial Evaluation of Functional Logic Programs

Languages that integrate functional and logic programming with a complete operational semantics are based on narrowing, a unification-based goal-solving mechanism which subsumes the reduction principle of functional languages and the resolution principle of logic languages. Formal methods of transformation of functional logic programs can be based on this well-established operational semantics....

متن کامل

On Extra Variables in (Equational) Logic Programming

Extra variables in a clause are variables which occur in the body but not in the head. It has been argued that extra variables are necessary and contribute to the expressive power of logic languages. In the first part of this paper, we show that this is not true in general. For this purpose, we provide a simple syntactic transformation of each logic program into a logic program without extra va...

متن کامل

Max-planck-institut F Ur Informatik on Extra Variables in (equational) Logic Programming

Extra variables in a clause are variables which occur in the body but not in the head. It has been argued that extra variables are necessary and contribute to the expressive power of logic languages. In the rst part of this paper, we show that this is not true in general. For this purpose, we provide a simple syntactic transformation of each logic program into a logic program without extra vari...

متن کامل

A Method for Implementing Equational Theories as Logic Programs

Equational theories underly many elds of computing, including functional programming, symbolic algebra, theorem proving, term rewriting and constraint solving. In this paper we show a method for implementing many equational theories with a limited class of logic programs. We de ne regular equational theories, a useful class of theories, and illustrate with a number of examples how our method ca...

متن کامل

On fuzzy unfolding: A multi-adjoint approach

Pascual Juli an a Gin es Moreno b Jaime Penabad c aDepartment of Computer Science ESI, Univ. of Castilla{La Mancha Paseo de la Universidad, 4; 13071 Ciudad Real, Spain bDepartment of Computer Science cDepartment of Mathematics EPSA, Univ. of Castilla{La Mancha Campus Universitario, s/n; 02071 Albacete, Spain Abstract In the context of (fuzzy) logic programs, `unfolding' means to transform a pro...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 1992